package com.briup.pts.web.controller;

import com.briup.pts.config.response.Result;
import com.briup.pts.domain.bean.Batch;
import com.briup.pts.domain.bean.Hurdles;
import com.briup.pts.service.DropDownService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 25095
 * @description
 * @data 2024/11/29-11:20
 */
@Slf4j
@Tag(name="下拉列表")
@RestController
@Validated
@RequiredArgsConstructor
public class DropDownController {
    private final DropDownService service;

    @Operation(summary = "查询所有批次信息下拉列表")
    @GetMapping("/batch/queryAll")
    public Result<?> batch(){
        List<Batch> batches = service.queryAll();
        return Result.success(batches).apply("获取成功");
    }

    @Operation(summary = "查询所有栏圈信息下拉列表")
    @GetMapping("/hurdles/selectAllHurdles")
    public Result<?> hurdles(){
        List<Hurdles> Hurdless= service.selectAllHurdles();
        return Result.success(Hurdless).apply("获取成功");
    }

}
